package com.hp.ssm.service;


import com.hp.ssm.bean.Administrator;
import com.hp.ssm.bean.AdministratorExample;
import com.hp.ssm.mapper.AdministratorMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImp implements UserService {
    @Resource
    private AdministratorMapper mapper;

    @Override
    public Administrator login(AdministratorExample obj) {
            List<Administrator> list=mapper.selectByExample(obj);
        if(list!=null&&list.size()>0){
            return list.get(0);
        }else {
            return null;
        }
        }

    @Override
    public int add(Administrator obj) {
        return mapper.insertSelective(obj);
    }


}

